1. Field of the Invention
The present invention relates to a method and system for detecting early fires in a predetermined area, and more particularly, to a method and system that can detect if images contain flames and if a flame increases to be a fire.
2. Description of the Prior Art
Generally, a HSI (hue/saturation/intensity) domain is usually utilized for analyzing images, since hue, saturation and intensity can represent all combinations of light to describe color. One prior art method detects if images have flames in the HSI domain. The method includes capturing images in a predetermined area, transforming RGB of each pixel of the images into HSI, and determining if the HSI of each pixel complies with rules in the HSI domain.
In the prior art, the RGB of each pixel is transformed into the HSI by the following equations:
                              I          =                                    1              3                        ⁢                          (                              R                +                G                +                B                            )                                      ,                  0          ≤          I          ≤          1                                    (        1        )                                                                                    S                =                                ⁢                                  1                  -                                                            3                                              (                                                  R                          +                          G                          +                          B                                                )                                                              ⁡                                          [                                              min                        ⁡                                                  (                                                      R                            ,                            G                            ,                            B                                                    )                                                                    ]                                                                                  ,                              0                ≤                S                ≤                1                                                                                        H              =                            ⁢                              {                                                                            θ                                                                                                                if                          ⁢                                                                                                          ⁢                          B                                                ≤                        G                                                                                                                                                360                        -                        θ                                                                                                                                                                  if                            ⁢                                                                                                                  ⁢                            B                                                    >                          G                                                ,                                                                                                                                                                    θ              =                            ⁢                                                cos                                      -                    1                                                  ⁢                                  {                                                                                    1                        2                                            ⁡                                              [                                                                              (                                                          R                              -                              G                                                        )                                                    +                                                      (                                                          R                              +                              B                                                        )                                                                          ]                                                                                                            [                                                                                                            (                                                              R                                -                                G                                                            )                                                        2                                                    +                                                                                    (                                                              R                                -                                B                                                            )                                                        ⁢                                                          (                                                              G                                -                                B                                                            )                                                                                                      ]                                                                    1                        2                                                                              }                                                                                        (        2        )                                          0          ⁢          °                ≤        H        ≤                  360          ⁢          °                                    (        3        )            
In the prior art, HSI is utilized for analyzing flame. The HSI domain is divided into six regions, as shown in FIG. 1. FIG. 1 is a table of hue, RGB model and color range. The color range of a common fire is from red to yellow; therefore, the hue of fire is from 0 to 60 degrees. Saturation of a fire changes with background illumination. For instance, the color of a fire during the day or under an extra light source has a stronger saturation than that of during the night or having no light source. That is, the color of a fire during the day or with the extra light source displays less white while the color of fire during the night or having no light source displays more white. A fire found in images captured during the night is more white in hue because the fire is the typically the only luminous entity in the images. Additionally, for providing sufficient brightness in video processing, the intensity should be over a threshold. Experimental results according to the prior art show that each HSI pixel of a fire should satisfy the following conditions:0°≦H≦60°  (i)Brighter environment: 30≦S≦100, Darker environment: 20≦S≦100  (ii)127≦I≦255  (iii)
The method mentioned above for detecting fire includes a series of complicated equations to transform RGB into HSI, which requires intensive computations. Besides, the low bound of the saturation condition (ii) may be too small to work correctly and hence it will yield a false fire-detection due to the appearance of reflected flames.
Furthermore, in a fire detecting system, another important function is to generate a fire alarm to prevent a fire accident. The method for generating a fire alarm according to the prior art compares the number of fire pixels to a threshold. If the number of fire pixels in an image is larger than the threshold, a fire alarm is output. However, the method is confined by the distance between the fire and an image capturing device (such as a camera). This enormously increases the false fire alarm rate and thus cannot adequately achieve the purpose of detecting early fires.
For example, suppose that the size of a flame is constant, such as a flame of a candle or a lighter. This kind of flame does not constitute a fire accident; therefore, a fire alarm is not required. Please refer to FIG. 2 to FIG. 5. FIG. 2 and FIG. 4 are diagrams of the same flame 20 of a lighter and an image capturing device 12 separated by different distances. FIG. 2 shows that the flame 20 is far away from the image capturing device 12 and FIG. 4 shows that the flame 20 is near the image capturing device 12. The image capturing device 12 only captures images in a predetermined area. If the distance of the flame 20 and the image capturing device 12 is longer, as d1 shows in FIG. 2, the size of the flame 20 in a frame is much smaller; that is, the number of fire pixels is small, as shown in FIG. 3. On the contrary, if the distance of the flame 20 and the image capturing device 12 is shorter, as d2 shows in FIG. 4, the size of the flame 20 in a frame is much larger; that is, the number of fire pixels is large as shown in FIG. 4. As shown in FIG. 3 and FIG. 5, the flame 20 in FIG. 3 approximately occupies 1.4 squares and the flame 20 in FIG. 5 approximately occupies 14 squares. Suppose that the threshold is 7 squares, the fire alarm is not provided due to the result of FIG. 3 while the fire alarm is provided due to the result of FIG. 5. The same flame 20 of the lighter results in different effects due to the distance of the flame 20 to the image capturing device 12. The result of FIG. 3 does not lead to a false fire alarm, but the result of FIG. 5 does.
In another situation, supposing that the flame spreads out and forms a fire, a fire alarm should be generated. Please refer to FIG. 6 to FIG. 17. FIGS. 6, 8, and 10 show a flame 30 spreading out to be flames 40 and 50, the distance from the image capturing device 12 being d1. FIGS. 7, 9, and 11 show numbers of fire pixels of FIGS. 6, 8, and 10, respectively. FIGS. 12, 14, and 16 show a flame 30 spreading out to be flames 40 and 50, the distance from the image capturing device 12 being the shorter d2. FIGS. 13, 15, and 17 show numbers of fire pixels of FIGS. 12, 14, and 16, respectively. The image capturing device 12 only captures images in a predetermined area. If the distance between the flames 30, 40, and 50 and the image capturing device 12 is d1, the sizes of the flame 30, 40, and 50 in a frame are much smaller; that is, the numbers of fire pixels are small, as shown in FIGS. 7, 9, and 11. On the contrary, if the distance between the flames 30, 40, and 50 and the image capturing device 12 is d2, the sizes of the flame 30, 40, and 50 in a frame are much larger; that is, the numbers of fire pixels are large, as shown in FIGS. 13, 15, and 17. Suppose that the fire alarm is given if the number of fire pixels reaches 15. Although the flame 30 has spread to be the flame 50 thereby causing a fire accident, the fire alarm is not generated due to the result of FIG. 11 so occupants are not alerted to escape from the fire accident. Because the distance between the image capturing device 12 and the scene of the fire is longer, the image capturing device 12 has no ability to detect that the fire exists. Although the fire alarm is correctly provided due to the result of FIG. 17, this is only because the distance between the image capturing device 12 and the flame 50 is just right. In the prior art, the position of the fire cannot be detected in a real environment. The image capturing device 12 cannot accurately detect if a fire is formed. Therefore, the fire alarm cannot be efficiently provided to prevent a fire accident.